<!DOCTYPE html>
<html>
	<head>
	    <meta charset="UTF-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
	    <title>学生管理</title>
		<include file='Layout:ins_css' />
	        <style type="text/css">
	            #addBtn {
	                float: right;
	                margin: -7px -6px 9px;
	            }
	            #exportBtn{
	            	float: right;
	            	margin: -7px 10px 9px;
	            	
	            }
	            .price-div {
	                /*float: left;*/
	                margin: 12px 0px 6px 16px;
	            }
	
	            .price-div input {
	                width: 60%;
	               /* float: left;*/
	                margin-right: 6px;
	            }
	
	            .price-div p {
	                line-height: 25px;
	                margin-right: 6px;
	                float: left;
	            }
	
	            .price-div select {
	                /*float: left;*/
	                width: 60%;
                    max-width: 16em;
	                margin-right: 10px;
	            }
	            .cyf-form-group{
	                margin-top: 10px;
	                margin-bottom: 10px;
	
	            }
	            .select2-drop {
	                z-index: 10050 !important;
	            }
	
	            .select2-search-choice-close {
	                margin-top: 0 !important;
	                right: 2px !important;
	                min-height: 10px;
	            }
	            .select2-search-choice-close:before {
	                color: black !important;
	            }
	            /*防止select2不会自动失去焦点*/
	
	            .select2-container {
	                z-index: 16000 !important;
	            }
	
	            .select2-drop-mask {
	                z-index: 15990 !important;
	            }
	
	            .select2-drop-active {
	                z-index: 15995 !important;
	            }
	
	            .staff {
	                margin-top: 6px;
	            }
	            .nationality {
	                margin-right: 15px;
	            }
	            div.dataTables_filter label input{
	                width: 100%;
	            }
	            
	
	        </style>
	</head>
	<body>
		<div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title" style="display: block;">
                            <h5>学生管理</h5>
                           	<button class="btn btn-primary" id="addBtn">新增单个学生</button>
                           	<button class="btn btn-info" id="exportBtn">批量导入学生</button>
                        </div>
                        <div class="row s-row">
                            <div class="col-sm-12">
                                <div class="price-div">
                                    <form class="form-horizontal">
                                        <div class="form-group cyf-form-group">
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left" class="col-sm-4 control-label cvbnm">学院: </label>
                                                <select class="form-control col-sm-" id="college_id" name="college_id" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="college_info" id="college_info">
                                                        <option value="{$college_info.sch_id}">{$college_info.sch_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left;" class="col-sm-4 control-label cvbnm">系部: </label>
                                                <select class="form-control col-sm-" id="department_id" name="department_id" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="department_info" id="department_info">
                                                        <option value="{$department_info.dept_id}" pid="{$department_info.sch_id}"  style="display: none;">{$department_info.dept_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left;" class="col-sm-4 control-label cvbnm">专业: </label>
                                                <select class="form-control col-sm-" id="noun_id" name="noun_id" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="noun_info" id="noun_info">
                                                        <option value="{$noun_info.pro_id}" pid="{$noun_info.dept_id}"  style="display: none;">{$noun_info.pro_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group cyf-form-group">
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left;" class="col-sm-4 control-label cvbnm">班级: </label>
                                                <select class="form-control col-sm-" id="class_id" name="class_id" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="class_info" id="class_info">
                                                        <option value="{$class_info.cla_id}" pid="{$class_info.pro_id}"  style="display: none;">{$class_info.cla_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group cyf-form-group">
                                        	<div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left;" class="col-sm-4 control-label cvbnm">学号: </label>
                                                <input type="text" id="find_stu_number" name="find_stu_number" class="form-control" style="min-height: 30px"/>
                                            </div>

                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <table class="table table-striped table-bordered table-hover dataTables-example">
                                <thead>
                                <tr>
                                    <th width="16.66%">学号</th>
                                    <th width="16.66%">姓名</th>
                                    <th width="16.66%">班级</th>
                                    <th width="16.66%">性别</th>
                                    <th width="16.66%">状态</th>
                                    <th width="16.66%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Modal 新增单个学生-->
        <div class="modal fade" id="AdNoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">新增单个学生</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" id="form_add">
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属学院</label>
                                <select class="form-control poiu" id="sd_boss_add" name="sd_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_college" id="par_college">
                                        <option value="{$par_college.sch_id}">{$par_college.sch_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属系部</label>
                                <select class="form-control poiu" id="de_boss_add" name="de_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_department" id="par_department">
                                        <option value="{$par_department.dept_id}" pid="{$par_department.sch_id}" style="display: none;">{$par_department.dept_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属专业</label>
                                <select class="form-control poiu" id="noun_boss_add" name="noun_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_noun" id="par_noun">
                                        <option value="{$par_noun.pro_id}" pid="{$par_noun.dept_id}" style="display: none;">{$par_noun.pro_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所在班级</label>
                                <select class="form-control poiu" id="class_boss_add" name="class_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_class" id="par_class">
                                        <option value="{$par_class.cla_id}" pid="{$par_class.pro_id}" style="display: none;">{$par_class.cla_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label ">学号</label>
                                <div class="col-sm-7">
                                    <input type="text" id="add_student_id" name="add_student_id" class="form-control removeData">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">姓名</label>
                                <div class="col-sm-7">
                                    <input type="text" id="add_student_name" name="add_student_name" class="form-control removeData">
                                </div>
                            </div>
                            <!--<div class="form-group" style="display: none">-->
                                <!--<label class="col-sm-3 control-label">所在年级</label>-->
                                <!--<div class="col-sm-7">-->
                                    <!--<input type="text" id="add_stu_grade" name="add_stu_grade" class="form-control removeData">-->
                                <!--</div>-->
                            <!--</div>-->
                            <div class="form-group">
                                <label class="col-sm-3 control-label">性别</label>
                                <div class="col-sm-7">
                                	<select class="form-control" id="add_student_sex" name="add_student_sex" style="padding: 4px 12px;">
                                		<option value="0">请选择</option>
	                                    <option value="1">男</option>
	                                    <option value="2">女</option>
                                	</select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">状态</label>
                                <div class="col-sm-7">
                                	<select class="form-control" id="add_student_status" name="add_student_status" style="padding: 4px 12px;">
                                		<option value="0">请选择</option>
	                                    <option value="1">正常</option>
	                                    <option value="2">休学</option>
	                                    <option value="3">退学</option>
	                                    <option value="4">毕业</option>
                                	</select>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="add_btn">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Modal 批量导入学生-->
        <div class="modal fade" id="ExpotStuModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">批量导入某班学生信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" id="form_export">
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属学院</label>
                                <select class="form-control poiu" id="sd_boss_export" name="sd_boss_export">
                                    <option value="0">请选择</option>
                                    <volist name="par_college_export" id="par_college_export">
                                        <option value="{$par_college_export.sch_id}">{$par_college_export.sch_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属系部</label>
                                <select class="form-control poiu" id="de_boss_export" name="de_boss_export">
                                    <option value="0">请选择</option>
                                    <volist name="par_department_export" id="par_department_export">
                                        <option value="{$par_department_export.dept_id}" pid="{$par_department_export.sch_id}" style="display: none;">{$par_department_export.dept_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属专业</label>
                                <select class="form-control poiu" id="noun_boss_export" name="noun_boss_export">
                                    <option value="0">请选择</option>
                                    <volist name="par_noun_export" id="par_noun_export">
                                        <option value="{$par_noun_export.pro_id}" pid="{$par_noun_export.dept_id}" style="display: none;">{$par_noun_export.pro_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所在班级</label>
                                <select class="form-control poiu" id="class_boss_export" name="class_boss_export">
                                    <option value="0">请选择</option>
                                    <volist name="par_class_export" id="par_class_export">
                                        <option value="{$par_class_export.cla_id}" pid="{$par_class_export.pro_id}" style="display: none;">{$par_class_export.cla_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-3 col-sm-offset-3">
                                    <button><a href="__MODULE__/AccountManage/downLoadExcel">下载Excel模板</a></button>
                                </div>
                                <div class="col-sm-6" style="padding-left: 0px;">
                                	<label class="control-label" style="float: left;">你可以按照模板填写excel表格</label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">导入文件</label>
                                <div class="col-sm-7">
                                   <input class="file form-control" name="upload_file" id="upload_file" type="file" data-show-caption="true" multiple />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="add_export_btn">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Modal 编辑专业-->
        <div class="modal fade" id="EditNoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">编辑专业</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" id="form_edit">
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属学院</label>
                                <select class="form-control poiu" id="sd_boss_edit" name="sd_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_college_edit" id="par_college_edit">
                                        <option value="{$par_college_edit.sch_id}">{$par_college_edit.sch_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属系部</label>
                                <select class="form-control poiu" id="de_boss_edit" name="de_boss_add">
                                    <option value="0">请选择</option>
                                    <volist name="par_department_edit" id="par_department_edit">
                                        <option value="{$par_department_edit.dept_id}" pid="{$par_department_edit.sch_id}" style="display: none;">{$par_department_edit.dept_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所属专业</label>
                                <select class="form-control poiu" id="noun_boss_edit" name="noun_boss_edit">
                                    <option value="0">请选择</option>
                                    <volist name="par_noun_edit" id="par_noun_edit">
                                        <option value="{$par_noun_edit.pro_id}" pid="{$par_noun_edit.dept_id}" style="display: none;">{$par_noun_edit.pro_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">所在班级</label>
                                <select class="form-control poiu" id="class_boss_edit" name="class_boss_edit">
                                    <option value="0">请选择</option>
                                    <volist name="par_class_edit" id="par_class_edit">
                                        <option value="{$par_class_edit.cla_id}" pid="{$par_class_edit.pro_id}" style="display: none;">{$par_class_edit.cla_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label ">学号</label>
                                <div class="col-sm-7">
                                    <input type="text" id="edit_student_id" name="edit_student_id" class="form-control removeData">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">姓名</label>
                                <div class="col-sm-7">
                                    <input type="text" id="edit_student_name" name="edit_student_name" class="form-control removeData">
                                </div>
                            </div>
                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-3 control-label">所在年级</label>-->
                                <!--<div class="col-sm-7">-->
                                    <!--<input type="text" id="edit_stu_grade" name="edit_stu_grade" class="form-control removeData">-->
                                <!--</div>-->
                            <!--</div>-->
                            <div class="form-group">
                                <label class="col-sm-3 control-label">性别</label>
                                <div class="col-sm-7">
                                	<select class="form-control" id="edit_student_sex" name="edit_student_sex" style="padding: 4px 12px;">
                                		<option value="0">请选择</option>
	                                    <option value="1">男</option>
	                                    <option value="2">女</option>
                                	</select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">状态</label>
                                <div class="col-sm-7">
                                	<select class="form-control" id="edit_student_status" name="edit_student_status" style="padding: 4px 12px;">
                                		<option value="0">请选择</option>
	                                    <option value="1">正常</option>
	                                    <option value="2">休学</option>
	                                    <option value="3">退学</option>
	                                    <option value="4">毕业</option>
                                	</select>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="edit_btn">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <include file='Layout:ins_js' />
        <script type="text/javascript" src="__VENDOR__/fileinput/fileinput.min.js"></script>
		<script type="text/javascript" src="__VENDOR__/fileinput/locales/zh.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                //自检
                check_index();

                sTable = $(".table").DataTable({
                    "fnServerParams": function(aoData) {
                        aoData.push({
                            'name': 'class_id',
                            'value': $('select#class_id option:selected').val()
                        },{
                        	'name': 'stu_num',
                        	'value': $('#find_stu_number').val()
                        });
                    },
                    "bAutoWidth":false,
                    "oLanguage": {
                        "sLengthMenu": "每页 _MENU_ ",
                        "sProcessing": "处理中...",
                        "sZeroRecords": "没有匹配结果",
                        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                        "sInfoPostFix": "",
                        "sSearch": "搜索:",
                        "sUrl": "",
                        "sEmptyTable": "表中数据为空",
                        "sLoadingRecords": "载入中...",
                        "sInfoThousands": ",",
                        "oPaginate": {
                            "sFirst": "首页",
                            "sPrevious": "上页",
                            "sNext": "下页",
                            "sLast": "末页"
                        },
                        "oAria": {
                            "sSortAscending": ": 以升序排列此列",
                            "sSortDescending": ": 以降序排列此列"
                        }
                    },
                    "sAjaxSource": "__URL__/student_manage_ShowDatatables", //调用php后台接口方法地址
                    "aoColumns": [{
                        'data': 'stu_id'
                    },{
                        'data': 'stu_name'
                    },{
                        'data': 'cla_name'
                    },{
                        'data': 'stu_sex',
                    },{
                    	'data': 'stu_status',
                    },{
                        "data": null,
                        orderable: false,
                        render: function(data, type, row, meta) {
                            return '<a type="button" class="btn btn-success" href="#" onclick=editFromID(this) >编辑</a>|<a type="button" class="btn btn-danger" href="#" onclick=delFromID(this) >删除</a>'
                        }
                    }]
                });
            });
            //查询按钮
            $("select#college_id").change(function() {
                //console.log( $('select#college_id option:selected').val());
                var p_id = $("#college_id").val();
                $("#department_id option").hide();
                $('#department_id').val('0');
                $('option[pid=' + p_id + ']').show();
            });
            $("select#department_id").change(function() {
                //console.log( $('select#college_id option:selected').val());
                var p_id = $("#department_id").val();
                $("#noun_id option").hide();
                $('#noun_id').val('0');
                $('#noun_id option[pid=' + p_id + ']').show();
            });
            $("select#noun_id").change(function(){
                var p_id = $("#noun_id").val();
                $("#class_id option").hide();
                $('#class_id').val('0');
                $('#class_id option[pid=' + p_id + ']').show();
            });
            $("select#class_id").change(function(){
            	//console.log($('select#class_id option:selected').val())
            	sTable.ajax.reload();
            });
            $("#find_stu_number").bind("input propertychange chang",function(){
            	sTable.ajax.reload();
            });

            <!--------------   新增模态框相关     !----------------->
            //新增模态框 - 学院 选择事件-
            $('select#sd_boss_add').change(function () {
                var p_id = $("#sd_boss_add").val();
                $("#de_boss_add option").hide();
                $('#de_boss_add').val('0');
                $('#de_boss_add option[pid=' + p_id + ']').show();
            });
            $('select#de_boss_add').change(function () {
                var p_id = $("#de_boss_add").val();
                $("#noun_boss_add option").hide();
                $('#noun_boss_add').val('0');
                $('#noun_boss_add option[pid=' + p_id + ']').show();
            });
            $('select#noun_boss_add').change(function () {
                var p_id = $("#noun_boss_add").val();
                $("#class_boss_add option").hide();
                $('#class_boss_add').val('0');
                $('#class_boss_add option[pid=' + p_id + ']').show();
            });
            //新增模态框弹出
            $("#addBtn").on('click', function() {
                $("#AdNoModal").modal();
            });
            $("#add_btn").on('click', function() {
                var formData = $('#form_add').serializeArray();
                var postData = {};

                $(formData).each(function(i) {
                    postData[this.name] = this.value;
                });
                sil_loading();
                $.ajax({
                    type: "post",
                    url: "__URL__/add_student",
                    async: true,
                    data: postData,
                    dataType: 'json',
                    success: function(p) {
                        if(p.state) {
                            toastr.success(p.info);
                            $("#AdNoModal").modal('hide');
                            sTable.ajax.reload();
                        } else {
                            toastr.warning(p.info);
                        }
                        sil_reloading();
                    }
                });
            });
            <!--------------   编辑模态框相关     !----------------->
            //编辑模态框 - 学院 选择事件-
            $('select#sd_boss_edit').change(function () {
                var p_id = $("#sd_boss_edit").val();
                $("#de_boss_edit option").hide();
                $('#de_boss_edit').val('0');
                $('#de_boss_edit option[pid=' + p_id + ']').show();
            });
            $('select#de_boss_edit').change(function () {
                var p_id = $("#de_boss_edit").val();
                $("#noun_boss_edit option").hide();
                $('#noun_boss_edit').val('0');
                $('#noun_boss_edit option[pid=' + p_id + ']').show();
            });
            $('select#noun_boss_edit').change(function () {
                var p_id = $("#noun_boss_edit").val();
                $("#class_boss_edit option").hide();
                $('#class_boss_edit').val('0');
                $('#class_boss_edit option[pid=' + p_id + ']').show();
            });
            //编辑模态框弹出
            function editFromID(obj) {
                var Obj = $(obj).parent().parent();
                var rowdata = sTable.row(Obj).data();
                $('#sd_boss_edit').val(rowdata.sch_id);
                $('#de_boss_edit').val(rowdata.dept_id);
                $('#noun_boss_edit').val(rowdata.pro_id);
                $('#class_boss_edit').val(rowdata.cla_id);
                $('#edit_student_id').val(rowdata.stu_id);
                $('#edit_student_name').val(rowdata.stu_name);
                selectByText('edit_student_sex',rowdata.stu_sex);
                selectByText('edit_student_status',rowdata.stu_status);
                $("#EditNoModal").modal();
            }
            $("#edit_btn").on('click', function() {
                var formData = $('#form_edit').serializeArray();
                var postData = {};

                $(formData).each(function(i) {
                    postData[this.name] = this.value;
                });
                sil_loading();
                $.ajax({
                    type: "post",
                    url: "__URL__/edit_student",
                    async: true,
                    data: postData,
                    dataType: 'json',
                    success: function(p) {
                        if(p.state) {
                            toastr.success(p.info);
                            $("#EditNoModal").modal('hide');
                            sTable.ajax.reload();
                        } else {
                            toastr.warning(p.info);
                        }
                        sil_reloading();
                    }
                });
            });
            <!--------------   删除模态框相关     !----------------->
            function delFromID(obj) {
                var Obj = $(obj).parent().parent();
                var rowdata = sTable.row(Obj).data();
                swal({
                    title: '提示',
                    text: "确定要删除吗?",
                    type: 'warning',
                    showCancelButton: true,
                    confirmButtonColor: '#3085d6',
                    cancelButtonColor: '#d33',
                    confirmButtonText: '确定',
                    cancelButtonText: '取消'
                }).then(function(isConfirm) {
                    if(isConfirm) {
                        $.ajax({
                            type: "post",
                            url: "__URL__/delete_student",
                            async: true,
                            data: {
                                delete_student_id: rowdata.stu_id,
                            },
                            dataType: 'json',
                            success: function(p) {
                                toastr.success(p.info);
                                sTable.ajax.reload();
                            }
                        })
                    }
                });
            }

            <!--------------   导入模态框相关     !----------------->
            //导入模态框 - 学院 选择事件-
            $('select#sd_boss_export').change(function () {
                var p_id = $("#sd_boss_export").val();
                $("#de_boss_export option").hide();
                $('#de_boss_export').val('0');
                $('#de_boss_export option[pid=' + p_id + ']').show();
            });
            $('select#de_boss_export').change(function () {
                var p_id = $("#de_boss_export").val();
                $("#noun_boss_export option").hide();
                $('#noun_boss_export').val('0');
                $('#noun_boss_export option[pid=' + p_id + ']').show();
            });
            $('select#noun_boss_export').change(function () {
                var p_id = $("#noun_boss_export").val();
                $("#class_boss_export option").hide();
                $('#class_boss_export').val('0');
                $('#class_boss_export option[pid=' + p_id + ']').show();
            });
            //导入模态框弹出
            $('#exportBtn').click(function(){
                $("#ExpotStuModal").modal();
            });
            // 上传
    		$("#upload_file").fileinput({
				language: 'zh', //设置语言
				uploadUrl: "__URL__/UploadExcel", //上传的地址
				allowedFileExtensions: ['xls','xlsx'], //接收的文件后缀
				autoReplace: true,
				browseLabel: '上传文件',
				uploadAsync: false, //默认异步上传
				showUpload: false, //是否显示上传按钮
				showRemove: false, //显示移除按钮
				showPreview: false, //是否显示预览
				showCaption: false, //是否显示标题
				browseClass: "btn btn-primary", //按钮样式     
				dropZoneEnabled: true, //是否显示拖拽区域
				maxFileSize: 0, //单位为kb，如果为0表示不限制文件大小
				maxFileCount: 1, //表示允许同时上传的最大文件个数
				enctype: 'multipart/form-data',
				previewClass: 'previewPanel',
					//initialPreview: [
					//"<img src='__ROOT__/Uploads/Upload_brands/" + urlImg + " ' class='file-preview-image' />",
					//],
				previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
					
			});
			//同步上传成功结果处理
			$('#upload_file').on('filebatchuploadsuccess', function(event, data, previewId, index) {
				// alert(data.response.info);
			});

			$('#add_export_btn').on('click',function () {
                $('#upload_file').fileinput('upload').on('filebatchuploadsuccess',function (event,data) {
                        if(data.response.state){
                            var formData = $('#form_export').serializeArray();
                            var postData = {};
                            $(formData).each(function(i) {
                                postData[this.name] = this.value;
                            });
                            var k = 0;
                            var data_list = new Array();
                            for(var value in data.response.list){
                                var dataTemp = $.extend(data.response.list[value],postData);
                                data_list.push(dataTemp);
                            }
                            sil_loading();
                            $.ajax({
                                type: "post",
                                url: "__URL__/export_student",
                                async: true,
                                data: {
                                    'data_list' : data_list,
                                },
                                dataType: 'json',
                                success: function(p) {
                                    if(p.state) {
                                        toastr.success(p.info);
                                        $("#ExpotStuModal").modal('hide');
                                        sTable.ajax.reload();
                                    } else {
                                        toastr.warning(p.info);
                                    }
                                    sil_reloading();
                                }
                            });
                        }
                });
            });
        </script>
	</body>
</html>